﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户登录</title>
   <link rel="stylesheet" type="text/css" href="css/common.css" />
   <script type="text/javascript">
       function gel(id) {return document.getElementById(id); }

      

       function gel(id) { return document.getElementById(id); }
       window.onload = function () {
           gel("btnL").onclick = validate;
       }
       function validate() {
           var uName = gel("txtUName");
           var uPwd = gel("txtPwd");
           var reg = /^[0-9a-zA-Z]{6,16}$/;
           if (uName.value == "" || !reg.test(uName.value)) {
               uName.focus(); //控件获得焦点
               gel("msgUname").className = "errMsg"; //更换msgUname 的 class（样式表）为 errMsg
               return false; //阻断当前代码执行(后面的不执行了)
           } else { gel("msgUname").className = "hid"; }
           if (uPwd.value == "" || !reg.test(uPwd.value)) {
               uPwd.focus();
               gel("msgPwd").className = "errMsg";
               return false;
           } else {
               gel("msgPwd").className = "hid";
           }
           alert("aaa");
           gel("fLogin").submit();
       }
       function getVcode() {
           gel("vcod").src = "vcode.ashx?d=" + new Date();
       }

   </script>
</head>
<body>
<center>
<form id="fLogin" action="" method="post" runat="server">
    <table id="title" border="0">
        <tr>
            <td>登录界面</td>
        </tr>
    </table>&nbsp;<table id="content" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td style="height:50px;">
            </td>
            <td style="width:35%;">
            </td>
            <td style="width:173px">
            </td>
        </tr>
        <tr>
            <td class="descTd">用户名：</td>
            <td><input name="txtUName" type="text" id="txtUName" class="inputT" value="111111" /></td>
            <td style="width: 173px" align="left" valign="middle"><div id="msgUname" class="<%=strNameErr%>">6-16个英文或数字</div></td>
        </tr>
        <tr>
            <td class="descTd">密&nbsp;&nbsp;&nbsp;码：</td>
            <td><input name="txtPwd" type="text" id="txtPwd" class="inputT"  value="111111"/></td>
            <td style="width: 173px" align="left"><div id="msgPwd" class="<%=strPwdErr%>">6-16个英文或数字</div></td>
        </tr>
        <tr>
            <td class="descTd">验证码：</td>
            <td><input name="txtVcode" type="text" id="txtVcode" class="inputT" /></td>
            <td style="width: 173px" align="left"><img id="vcod" onclick="getVcode()" src="Vcode.ashx" /></td>
        </tr>
        <tr>
            <td >
                <input type="checkbox" name="chkIsAlways" value="1" />两周内自动登录</td>
            <td>
                <input type="button" id="btnL" value="登录" class="btnC" />
                <input type="button" id="btnC" value="取消" class="btnC" />
            </td>
            <td style="width: 173px"><a href="register.aspx">注  册</a></td>
        </tr>
        <tr>
            <td>
                </td>
            <td>
                </td>
            <td style="height:50px;"></td>
        </tr>
    </table>
    <input type="hidden" value="1" name="pback" />
</form>
</center>
</body>
</html>
